<template>
  <div id="app">	  
    		<router-view :swiperList="swiperList" :icon_img="icon_img" :icon_list="icon_list" :coupon_list="coupon_list" :seckill_link="seckill_link" :seckill_list="seckill_list" :seckill_tit="seckill_tit" :goods_list1_data="goods_list1_data" :goods_list1_img="goods_list1_img" :goods_list1_2_data="goods_list1_2_data" :goods_list1_2_img="goods_list1_2_img" :goods_list2_data="goods_list2_data" :goods_list2_title="goods_list2_title"></router-view>
    	<tab-menu></tab-menu>
  </div>
  
</template>

<script>
import TabMenu from '@/common/TabMenu.vue'	

import axios from 'axios'
export default {
  name: 'App',
  components:{
  	TabMenu
  },
  data(){
    return{
      swiperList:[],
      icon_img:'',
      icon_list:[],
      coupon_list:[],
      seckill_link:'',
      seckill_list:[],
      seckill_tit:'',
      goods_list1_data:[],
      goods_list1_img:'',
      goods_list1_2_data:[],
      goods_list1_2_img:'',
      goods_list2_data:[],
      goods_list2_title:''
    }
  },
  methods:{
    getHomeInfo:function(){
      axios.get('/api/getTitle_id=101.json')
        .then(this.getHomeInfoSucc)
    },
    getHomeInfoSucc:function(res){
      res=res.data
      //console.log(res)
      if(res.data){
        const data=res.data
        this.swiperList=data[0].data     
        this.icon_img=data[1].img_url  
        this.icon_list=data[1].protocolList   
        this.coupon_list=data[2].data   
        this.seckill_link=data[5].h5_url  
        this.seckill_list=data[5].data
        this.seckill_tit=data[5].title
        this.goods_list1_data=data[7].data[0].products
        this.goods_list1_img=data[7].data[0].img_url
        this.goods_list1_2_data=data[8].data[0].products
        this.goods_list1_2_img=data[8].data[0].img_url
        this.goods_list2_data=data[10].data
        this.goods_list2_title=data[10].title_string
      }     
    }
  },
  mounted(){
    this.getHomeInfo()
  }
}
</script>

<style>

</style>
